﻿#ifndef RELAYTIMER_H
#define RELAYTIMER_H

#include <QString>

#define TIME_SUNRISE        -1
#define TIME_SUNSET         -2
#define TIME_SUNRISE_STR    "-1"
#define TIME_SUNSET_STR     "-2"
#define DISP_SUNRISE_STR    tr("일출")
#define DISP_SUNSET_STR     tr("일몰")

#define ACTION_OFF          0
#define ACTION_ON           1
#define ACTION_AIR          2
#define ACTION_COOLING      3
#define ACTION_HEATING      4


class RelayTimer
{
public:
    RelayTimer();
    RelayTimer(quint8 cid, quint8 bid, quint8 rid, QString& startTime, quint8 startAction, QString& endTime, quint8 endAction, quint8 dayOfWeek);

    static bool parseTime(QString time, int *hour, int *minute);

public:
    quint8 mCId;
    quint8 mBId;
    quint8 mRId;

    QString mStartTime;
    quint8 mStartAction;
    QString mEndTime;
    quint8 mEndAction;
    quint8 mDayOfWeek;  // [7]used, [6]sat, [5]fri, ..., [0]sun

    QString uuid;

    int mStartSunLight;
    int mEndSunLight;
};

#endif // RELAYTIMER_H
